using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Drawing;

namespace GaDeTrung
{
    public class Chicken
    {
        private PictureBox ptBox;
        public char chickenType;

        public int Top
        {
            set { ptBox.Top = value; }
            get { return ptBox.Top; }
        }

        public int Left
        {
            set { ptBox.Left = value; }
            get { return ptBox.Left; }
        }

        public Chicken()
        {
            ptBox = new PictureBox();
            ptBox.Size = new Size(82, 88);
            ptBox.SizeMode = PictureBoxSizeMode.StretchImage;
            ptBox.BackColor = Color.Transparent;
			ChangeType('G');
        }
		
		public void ChangeType (char type)
		{
			char oldType = chickenType;
			chickenType = type;
			switch (chickenType)
			{
				case (char)'g':
				case (char)'G':
					ptBox.Image = Properties.Resources.ga;
					ptBox.Update();
					break;
				case (char)'v':
				case (char)'V':
					ptBox.Image = Properties.Resources.vit;
					ptBox.Update();
					break;
				case (char)'n':
				case (char)'N':
					ptBox.Image = Properties.Resources.ngan;
					ptBox.Update();
					break;
			}
		}
		
        public void AddToParent(Form form)
        {
            form.Controls.Add(ptBox);
        }
        //public void Select_KeyPress(object sender, KeyEventArgs e)
        //{
        //    if (e.KeyCode == Keys.G)
        //    {
        //        str = "G";
        //    }
        //    if (e.KeyCode == Keys.V)
        //    {
        //        str = "V";
        //    }
        //    if (e.KeyCode == Keys.N)
        //    {
        //        str = "N";
        //    }
        //}

        // public void LayEgg(Form form)
        // {

            // Egg egg = new Egg();
            // egg.AddToParent(form);
            // egg.Top =  this.Top + 100;
            // egg.Left = this.Left + 25;

        // }

        public void RemoveFromParent()
        {
            if (ptBox.Parent != null)
            {
                ptBox.Parent.Controls.Remove(ptBox);
            }
        }
    }
}
